import request from '@/utils/request'

export default{

    //分页讲师查询的方法
    getFrontCourseList: async(page,size,couserQuery) => {
        console.log('getFrontCourseList')
        let data = await request({
            url: `/edu/courseFront/getFrontCourse/${page}/${size}`,
            method: 'post',
            data: couserQuery
        })
        return data
    },

    //课程详情查询
    getFrontCourseInfo(courseId){
    return request(
            {
            url: `/edu/courseFront/getFrontCourseInfo/${courseId}`,
            method: 'get'
            }
        )
    },

    getCourseByTea(){
        return request(
                {
                    url: `/teacher/getAllCourses`,
                    method: 'get'
                }
            )
    },

    createCourse(courseInfo) {
        return request({
            url: '/course/createCourse',
            method: 'post',
            data: courseInfo
        })
    },

    getAllCourse(limit, offset) {
        return request({
            url: `/course/createCourse/${limit}/${offset}`,
            method: 'get'
        })
    },

    editCourse(courseInfo) {
        return request({
            url: '/course/editCourse',
            method: 'post',
            data: courseInfo
        })
    },

    //查询所有分类
    getAllSubject(){
        return request({
            url: '/edu/subject/findAllSubject',
            method: 'get'
        })
    }
}